iT邦幫忙

2025 iThome 鐵人賽

DAY 12
0

今天我們來製作單據控管系統,利用google sheet作為我們的資料庫,使用GAS做出前端和後端程式碼。

程式碼解析

function addInvoice(id, name, amount, note) {
  var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Invoices");
  sheet.appendRow([new Date(), id, name, amount, "待審核", note]);
}

設定一個function將單據收到sheet裡面

function doGet() {
  return HtmlService.createHtmlOutputFromFile('form');
}

使用doGet連接html,並在GAS中新增一個html檔案用以連接。

結果

https://ithelp.ithome.com.tw/upload/images/20250821/2016946615MHckbJQi.png


上一篇
D11 出缺席查詢
下一篇
D13 單據管理系統實作
系列文
Google App Script雲端自動化與動態網頁實戰23
圖片
  熱門推薦
圖片
{{ item.channelVendor }} | {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言